﻿using huqiang.Core.HGUI;
using System;
using System.Collections.Generic;
using UnityEngine;

public class Setting
{
    public const string Lan = "Lan";
    public const string Chinese = "Chinese";
    public const string English = "English";
    public static string Language = "Chinese";
    public static void LoadSetting()
    {
        if (PlayerPrefs.HasKey(Lan))
        {
            Language = PlayerPrefs.GetString(Lan);
        }
        else
        {
            switch (Application.systemLanguage)
            {
                case SystemLanguage.Chinese:
                case SystemLanguage.ChineseSimplified:
                case SystemLanguage.ChineseTraditional:
                    PlayerPrefs.SetString(Lan, Chinese);
                    Language = Chinese;
                    break;
                default:
                    PlayerPrefs.SetString(Lan, English);
                    Language = English;
                    break;
            }
        }
    }
}